import 'dart:collection';

import 'package:azlistview/azlistview.dart';
import 'package:shihui/blocs/bloc_provider.dart';
import 'package:shihui/common/component_index.dart';
import 'package:shihui/data/repository/worldexchange_repository.dart';

class ProcessBloc extends BlocBase {
  WorldExchangeRepository worldExchangeRepository =
      new WorldExchangeRepository();

   BehaviorSubject<ArticleModel> articleItem =
       BehaviorSubject<ArticleModel>();

  ArticleModel _articleModel;

   Sink<ArticleModel> get articleSink => articleItem.sink;

   Stream<ArticleModel> get articleStream => articleItem.stream;

  @override
  void dispose() {
    // TODO: implement dispose
    articleItem.close();
  }

  @override
  Future onLoadMore({String labelId}) {
    // TODO: implement onLoadMore
    return null;
  }

  @override
  Future onRefresh({String labelId}) {
    // TODO: implement onRefresh
    return null;
  }

  Future loadProcess() async {
    worldExchangeRepository.getProcessDetail().then((model){
      _articleModel = model;
      articleSink.add(_articleModel);
    });
  }
}
